<template>
  <TArea ref="TAreaRef" v-model="codes" @change="changeTest">
    test
  </TArea>
  <p>结果：{{ codes }}</p>
  <p>中文内容：{{ currentInfo }}</p>
  <el-button @click="setDefault">设置默认值回显</el-button>
</template>
<script lang="ts" setup>
import { TArea } from '@twa/components'
import { nextTick, ref } from 'vue'
const codes = ref<Array<string>>()
const currentInfo = ref()
const setDefault = () => {
  codes.value = ['110000', '110100', '110101']
  nextTick(() => {
    currentInfo.value = TAreaRef.value.cascaderRef.getCheckedNodes()[0]?.pathLabels
    console.log(TAreaRef.value.cascaderRef.getCheckedNodes(true)[0]?.pathLabels)
  })
}

const TAreaRef = ref()
const changeTest = (value) => {
  console.log(value)
  console.log(TAreaRef.value)
}
</script>
